<template>
  <el-table :data="datas.data">
    <el-table-column prop="id" label="ID">
    </el-table-column>
    <el-table-column prop="name" label="名称">
    </el-table-column>
    <el-table-column prop="no" label="编号">
    </el-table-column>
    <el-table-column prop="marketPrice" label="市场价">
    </el-table-column>
    <el-table-column prop="price" label="当前价格">
    </el-table-column>
    <el-table-column prop="description" label="描述">
    </el-table-column>
    <el-table-column prop="enabled" label="上架">
    </el-table-column>
    <el-table-column prop="hits" label="点击率">
    </el-table-column>
    <el-table-column prop="cdt" label="录入时间" :formatter="cdtFormatter">
    </el-table-column>
  </el-table>
</template>

<script>
  import utils from "@/bianmaba-exteneds/modules/utils"

  export default {
    name: "Table",
    data() {
      return {
        datas: []
      };
    },
    methods: {
      cdtFormatter: function (row, col, value) {
        return utils.dateFormat(value, "yyyy/MM/dd");
      }
    },
    mounted() {
      let params = {pageable: {page: 0, size: 2}};
      this.ajax.post("/management/product/query", params).then(resp => {
        if (resp && resp.data && resp.data.success == true) {
          this.datas = resp.data;
        }
      })
    }
  }
</script>

<style scoped>

</style>
